<?php
namespace information\action;

use herosphp\bean\Beans;
use herosphp\core\Controller;
use herosphp\core\WebApplication;
use herosphp\http\HttpRequest;
use herosphp\utils\Page;
use herosphp\files\FileUpload;

use herosphp\utils\AjaxResult;

define('COM_ERR_MSG', '(⊙o⊙) 系统出了小差！');

/**
 * 前端模块通用 Action
 * @author          horse<314330288@qq.com>
 *为了数据的安全性，此控制器中不对数据库进行操作
 */
use common\action\FrontCommonAction as BaseAction;
class CommonAction extends BaseAction {

    protected $inforCateService = null;
    protected $inforService= null;
    protected $adService= null;

    public function C_start()
    {
        $this->inforCateService = Beans::get("information.informationCate.service");
        $this->inforService = Beans::get("information.information.service");
        parent::C_start();
    }
    public function more(HttpRequest $request)
    {
        $cate_id = $request->getParameter('cate','intval');
        $page = $request->getParameter('page','intval');
        $this->page = $page==0?1:$page;
        $total = $this->inforService->count(array('cate_id'=>$cate_id,'release_status'=>1));
        $this->getPagemenu($total,0,'条资讯');
    }

    /**
     * @param string $title
     * @param string $keywords
     * @param string $desc
     */
    public function setHead($title='',$keywords='',$desc='')
    {
        $this->setTitle($title);
        $this->setKeyword($keywords);
        $this->setDescription($desc);
    }
}
